clear
load W_time1_eh0_comp1.out 
load W_time2_eh0_comp1.out
load ParEst_eh0_time0_Mex_allboots ParEst_eh0_time0_Mex_allboots
load ParEst_eh0_time1_Mex_allboots ParEst_eh0_time1_Mex_allboots

boot_t0=ParEst_eh0_time0_Mex_allboots(:,end); 
boot_t1=ParEst_eh0_time1_Mex_allboots(:,end);

theta= 10.^(ParEst_eh0_time0_Mex_allboots(:,21));
a_h=1000*ParEst_eh0_time0_Mex_allboots(:,22);
gamma_h = 500*ParEst_eh0_time1_Mex_allboots(:,1);
a_l=1000*ParEst_eh0_time0_Mex_allboots(:,25);
gamma_l = 500*ParEst_eh0_time1_Mex_allboots(:,2);

w_mom0=W_time1_eh0_comp1(boot_t0,17); % Read wage moments
p50wi_1=w_mom0; 
HH_avg_Inc = p50wi_1; % median wage of informal men
MWP_a_boot_h = a_h./(exp(-theta.*HH_avg_Inc));
MWP_a_boot_l = a_l./(exp(-theta.*HH_avg_Inc));

for i= boot_t0'
    for j= boot_t1'
    if i==j
        auxtheta(j)= 10.^(ParEst_eh0_time0_Mex_allboots(find(ParEst_eh0_time0_Mex_allboots(:,end)==i),21));   
    end
    end
end
theta_1= nonzeros(auxtheta);
w_mom1=W_time2_eh0_comp1(boot_t1,17); % Read wage moments
p50wi_1=w_mom1; 
HH_avg_Inc = p50wi_1; % median wage of informal men
MWP_gamma_boot_h = gamma_h./(exp(-theta_1.*HH_avg_Inc));
MWP_gamma_boot_l = gamma_l./(exp(-theta_1.*HH_avg_Inc));

save MWP_a_boot_h MWP_a_boot_h
save MWP_a_boot_l MWP_a_boot_l
save MWP_gamma_boot_h MWP_gamma_boot_h
save MWP_gamma_boot_l MWP_gamma_boot_l